package com.bt.lms.ui.page.stu;

import com.bt.lms.ui.action.registration.stu.PageAuditCancelBtnAction;
import com.bt.lms.ui.action.registration.stu.PageAuditNoBtnAction;
import com.bt.lms.ui.action.registration.stu.PageAuditYesBtnAction;
import com.bt.lms.ui.page.sys.style.BtnStyle;
import javafx.collections.ObservableList;
import javafx.geometry.Insets;
import javafx.scene.Cursor;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;

/**
 * 审核报名学员信息界面
 */
public class PageAuditApplyStu extends VBox {

    /**
     * 审核报名学员信息界面长
     */
    private double preWidth = 1280;
    /**
     * 审核报名学员信息界面高
     */
    private double preHeight = 800;

    /**
     * 标签默认长度
     */
    private double labDefaultWidth = 200;

    public PageAuditApplyStu(){

        this.setPrefSize(preWidth,preHeight);
        this.setPadding(new Insets(5));
        this.setSpacing(20);

        //顶部横向盒子
        HBox topHBox = new HBox();
        initTopHBox(topHBox);
        //审核报名学员信息横向盒子
        HBox auditApplyStuInfoHBox = new HBox();
        initAuditApplyStuInfoHBox(auditApplyStuInfoHBox);
        //帐号横向盒子
        HBox accountHBox = new HBox();
        initAccountHBox(accountHBox);
        //学员编号横向盒子
        HBox stuNumHBox = new HBox();
        initStuNumHBox(stuNumHBox);
        //姓名横向盒子
        HBox nameHBox = new HBox();
        initNameHBox(nameHBox);
        //性别横向盒子
        HBox genderHBox = new HBox();
        initGenderHBox(genderHBox);
        //出生日期横向盒子
        HBox birthdayHBox = new HBox();
        initBirthdayHBox(birthdayHBox);
        //证件类型横向盒子
        HBox IDTypeHBox = new HBox();
        initIDTypeHBox(IDTypeHBox);
        //证件号码横向盒子
        HBox IDNumHBox = new HBox();
        initIDNumHBox(IDNumHBox);
        //所属学习中心横向盒子
        HBox learningCenterHBox = new HBox();
        initLearningCenterHBox(learningCenterHBox);
        //所属招生计划横向盒子
        HBox ofEnPHBox = new HBox();
        initOfEnPHBox(ofEnPHBox);
        //电子邮箱横向盒子
        HBox emailHBox = new HBox();
        initEmailHBox(emailHBox);
        //移动电话横向盒子
        HBox movePhoneHBox = new HBox();
        initMovePhoneHBox(movePhoneHBox);
        //联系电话横向盒子
        HBox phoneHBox = new HBox();
        initPhoneHBox(phoneHBox);
        //报名材料横向盒子
        HBox applyMaterialHBox = new HBox();
        initApplyMaterialHBox(applyMaterialHBox);
        //材料盒子
        HBox materialHBox = new HBox();
        initMaterialHBox(materialHBox);
        //报名信息审核盒子
        HBox applyInfoHBox = new HBox();
        initApplyInfoHBox(applyInfoHBox);
        //当前审核状态盒子
        HBox auditHBox =  new HBox();
        initAuditHBox(auditHBox);
        //审核意见横向盒子
        HBox auditIdeaHBox = new HBox();
        initAuditIdeaHBox(auditIdeaHBox);


        //滚动条盒子
        VBox scrollPaneVBox = new VBox();
        ScrollPane scrollPane = new ScrollPane();
        scrollPane.setContent(scrollPaneVBox);
        scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS);
        scrollPane.setPrefSize(preWidth,preHeight);

        scrollPaneVBox.getChildren().addAll(topHBox,auditApplyStuInfoHBox,accountHBox,stuNumHBox,nameHBox,genderHBox,birthdayHBox,IDTypeHBox,IDNumHBox,learningCenterHBox,ofEnPHBox,emailHBox,movePhoneHBox,phoneHBox,applyMaterialHBox,materialHBox,applyInfoHBox,auditHBox,auditIdeaHBox);

        ObservableList<Node> children = this.getChildren();
        children.addAll(scrollPane);




    }



    /**
     * 审核意见横向盒子
     * @param auditIdeaHBox
     */
    private void initAuditIdeaHBox(HBox auditIdeaHBox) {
        auditIdeaHBox.setPadding(new Insets(20));
        auditIdeaHBox.setSpacing(20);
        //审核意见标签
        Label auditIdeaLab = new Label("审核意见");
        auditIdeaLab.setPrefWidth(labDefaultWidth);//标签默认长度
        auditIdeaLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //审核意见文本框
        TextField auditIdeaTF = new TextField();
        //审核通过按钮
        Button auditYesBtn = new Button("审核通过");
        BtnStyle.saveBtn(auditYesBtn);

        //审核通过按钮事件
        PageAuditYesBtnAction pageAuditYesBtnAction = new PageAuditYesBtnAction();
        auditYesBtn.setOnAction(pageAuditYesBtnAction);
        auditYesBtn.setCursor(Cursor.HAND);
        //审核不通过按钮
        Button auditNoBtn = new Button("审核不通过");
        BtnStyle.cancelBtn(auditNoBtn);

        //审核不通过按钮事件
        PageAuditNoBtnAction pageAuditNoBtnAction = new PageAuditNoBtnAction();
        auditNoBtn.setOnAction(pageAuditNoBtnAction);
        auditNoBtn.setCursor(Cursor.HAND);
        //取消按钮
        Button cancelBtn = new Button("取消");
        BtnStyle.cancelBtn(cancelBtn);

        //取消按钮事件
        PageAuditCancelBtnAction pageAuditCancelBtnAction = new PageAuditCancelBtnAction();
        cancelBtn.setOnAction(pageAuditCancelBtnAction);
        cancelBtn.setCursor(Cursor.HAND);


        ObservableList<Node> children = auditIdeaHBox.getChildren();
        children.addAll(auditIdeaLab,auditIdeaTF,auditYesBtn,auditNoBtn,cancelBtn);



    }

    /**
     * 当前审核状态盒子
     * @param auditHBox
     */
    private void initAuditHBox(HBox auditHBox) {
        auditHBox.setPadding(new Insets(20));
        auditHBox.setSpacing(20);
        //当前审核状态标签
        Label auditStatusLab = new Label("当前审核状态");
        auditStatusLab.setPrefWidth(labDefaultWidth);//标签默认长度
        auditStatusLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //待审核标签
        Label waitAuditLab = new Label("待审核");
        ObservableList<Node> children = auditHBox.getChildren();
        children.addAll(auditStatusLab,waitAuditLab);

    }

    /**
     * 报名信息审核盒子
     * @param applyInfoHBox
     */
    private void initApplyInfoHBox(HBox applyInfoHBox) {
        applyInfoHBox.setPadding(new Insets(20));
        //报名信息审核标签
        Label applyInfoLab = new Label("报名信息审核");
        //设置字体大小
        applyInfoLab.setFont(Font.font(null,FontWeight.BOLD,null,22));
        applyInfoLab.setTextFill(Color.rgb(198,0,1));//字体颜色
        ObservableList<Node> children = applyInfoHBox.getChildren();
        children.addAll(applyInfoLab);
    }

    /**
     * 材料盒子
     * @param materialHBox
     */
    private void initMaterialHBox(HBox materialHBox) {
        materialHBox.setSpacing(20);
        materialHBox.setPadding(new Insets(10));
        //证明材料1标签
        Label oneMaterialLab = new Label("证明材料1");
        String oneUrl = "File:C:\\Users\\朱传博1120\\Desktop\\QQ图片20230329095859.png";//图片全路径
        Image oneImage = new Image(oneUrl);
        ImageView oneImageView = new ImageView(oneImage);//视图显示
        oneImageView.setFitWidth(100);
        oneImageView.setFitHeight(100);
        //证明材料2标签
        Label twoMaterialLab = new Label("证明材料2");
        String twoUrl = "File:C:\\Users\\朱传博1120\\Desktop\\QQ图片20230329095605.jpg";//图片全路径
        Image twoImage = new Image(twoUrl);
        ImageView twoImageView = new ImageView(twoImage);//视图显示
        twoImageView.setFitWidth(100);
        twoImageView.setFitHeight(100);
        //证明材料3标签
        Label threeMaterialLab = new Label("证明材料3");
        String threeUrl = "File:C:\\Users\\朱传博1120\\Desktop\\QQ图片20230329095942.png";//图片全路径
        Image threeImage = new Image(threeUrl);
        ImageView threeImageView = new ImageView(threeImage);//视图显示
        threeImageView.setFitWidth(100);
        threeImageView.setFitHeight(100);
        ObservableList<Node> children = materialHBox.getChildren();
        children.addAll(oneMaterialLab,oneImageView,twoMaterialLab,twoImageView,threeMaterialLab,threeImageView);


    }

    /**
     * 报名材料横向盒子
     * @param applyMaterialHBox
     */
    private void initApplyMaterialHBox(HBox applyMaterialHBox) {
        applyMaterialHBox.setPadding(new Insets(20));
        //报名材料标签
        Label applyMaterialLab = new Label("报名材料");
        //设置字体大小
        applyMaterialLab.setFont(Font.font(null,FontWeight.BOLD,null,22));
        applyMaterialLab.setTextFill(Color.rgb(198,0,1));//字体颜色
        ObservableList<Node> children = applyMaterialHBox.getChildren();
        children.addAll(applyMaterialLab);
    }

    /**
     * 联系电话横向盒子
     * @param phoneHBox
     */
    private void initPhoneHBox(HBox phoneHBox) {
        phoneHBox.setPadding(new Insets(20));
        phoneHBox.setSpacing(20);
        //联系电话标签
        Label phoneLab = new Label("联系电话");
        phoneLab.setPrefWidth(labDefaultWidth);//标签默认长度
        phoneLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //张三联系电话标签
        Label zsPhoneLab = new Label("010-445123");
        ObservableList<Node> children = phoneHBox.getChildren();
        children.addAll(phoneLab,zsPhoneLab);

    }

    /**
     * 移动电话横向盒子
     * @param movePhoneHBox
     */
    private void initMovePhoneHBox(HBox movePhoneHBox) {
        movePhoneHBox.setPadding(new Insets(20));
        movePhoneHBox.setSpacing(20);
        //移动电话标签
        Label movePhoneLab = new Label("移动电话");
        movePhoneLab.setPrefWidth(labDefaultWidth);//标签默认长度
        movePhoneLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //zs电话号标签
        Label zsMoveNumLab = new Label("123553");
        ObservableList<Node> children = movePhoneHBox.getChildren();
        children.addAll(movePhoneLab,zsMoveNumLab);


    }

    /**
     * 电子邮箱横向盒子
     * @param emailHBox
     */
    private void initEmailHBox(HBox emailHBox) {
        emailHBox.setPadding(new Insets(20));
        emailHBox.setSpacing(20);
        //电子邮箱标签
        Label emailLab = new Label("电子邮箱");
        emailLab.setPrefWidth(labDefaultWidth);//标签默认长度
        emailLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //张三电子邮箱标签
        Label zsEmailLab = new Label("zs@qq.com");
        ObservableList<Node> children = emailHBox.getChildren();
        children.addAll(emailLab,zsEmailLab);

    }

    /**
     * 所属招生计划横向盒子
     * @param ofEnPHBox
     */
    private void initOfEnPHBox(HBox ofEnPHBox) {
        ofEnPHBox.setPadding(new Insets(20));
        ofEnPHBox.setSpacing(20);
        //所属招生计划标签
        Label ofEnPLab = new Label("所属招生计划");
        ofEnPLab.setPrefWidth(labDefaultWidth);//标签默认长度
        ofEnPLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //张三所属招生计划标签
        Label zsEnpLab = new Label("济南博添夏季招生计划");
        ObservableList<Node> children = ofEnPHBox.getChildren();
        children.addAll(ofEnPLab,zsEnpLab);
    }

    /**
     * 所属学习中心
     * @param learningCenterHBox
     */
    private void initLearningCenterHBox(HBox learningCenterHBox) {
        learningCenterHBox.setPadding(new Insets(20));
        learningCenterHBox.setSpacing(20);
        //所属学习中心标签
        Label learningCenterLab = new Label("所属学习中心");
        learningCenterLab.setPrefWidth(labDefaultWidth);//标签默认长度
        learningCenterLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //详细学习中心标签
        Label detailLearningCenLab = new Label("济南");

        learningCenterHBox.getChildren().addAll(learningCenterLab,detailLearningCenLab);
    }


    /**
     * 证件号码横向盒子
     * @param idNumHBox
     */
    private void initIDNumHBox(HBox idNumHBox) {
        idNumHBox.setPadding(new Insets(20));
        idNumHBox.setSpacing(20);
        //证件号码标签
        Label IDNumLab = new Label("证件号码");
        IDNumLab.setPrefWidth(labDefaultWidth);//标签默认长度
        IDNumLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //号码标签
        Label numLab = new Label("661216565116");
        ObservableList<Node> children = idNumHBox.getChildren();
        children.addAll(IDNumLab,numLab);
    }

    /**
     * 证件类型横向盒子
     * @param idTypeHBox
     */
    private void initIDTypeHBox(HBox idTypeHBox) {
        idTypeHBox.setPadding(new Insets(20));
        idTypeHBox.setSpacing(20);
        //证件类型标签
        Label IDTypeLab = new Label("证件类型");
        IDTypeLab.setPrefWidth(labDefaultWidth);//标签默认长度
        IDTypeLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //身份证标签
        Label IDLab = new Label("身份证");
        ObservableList<Node> children = idTypeHBox.getChildren();
        children.addAll(IDTypeLab,IDLab);

    }

    /**
     * 出生日期横向盒子
     * @param birthdayHBox
     */
    private void initBirthdayHBox(HBox birthdayHBox) {
        birthdayHBox.setPadding(new Insets(20));
        birthdayHBox.setSpacing(20);
        //出生日期标签
        Label birthdayLab = new Label("出生日期");
        birthdayLab.setPrefWidth(labDefaultWidth);//标签默认长度
        birthdayLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //2002年01月12日标签
        Label zsBirthLab = new Label("2002年01月12日");
        ObservableList<Node> children = birthdayHBox.getChildren();
        children.addAll(birthdayLab,zsBirthLab);

    }

    /**
     * 性别横向盒子
     * @param genderHBox
     */
    private void initGenderHBox(HBox genderHBox) {
        genderHBox.setPadding(new Insets(20));
        genderHBox.setSpacing(20);
        //性别标签
        Label genderLab = new Label("性别");
        genderLab.setPrefWidth(labDefaultWidth);//标签默认长度
        genderLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //男标签
        Label manLab = new Label("男");
        ObservableList<Node> children = genderHBox.getChildren();
        children.addAll(genderLab,manLab);
    }

    /**
     * 姓名横向盒子
     * @param nameHBox
     */
    private void initNameHBox(HBox nameHBox) {
        nameHBox.setPadding(new Insets(20));
        nameHBox.setSpacing(20);
        //姓名标签
        Label nameLab = new Label("姓名");
        nameLab.setPrefWidth(labDefaultWidth);
        nameLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //张三标签
        Label zsLab = new Label("张三");
        ObservableList<Node> children = nameHBox.getChildren();
        children.addAll(nameLab,zsLab);

    }

    /**
     * 学员编号横向盒子
     * @param stuNumHBox
     */
    private void initStuNumHBox(HBox stuNumHBox) {
        stuNumHBox.setPadding(new Insets(20));
        stuNumHBox.setSpacing(20);
        //学员编号标签
        Label stuNumLab = new Label("学员编号");
        stuNumLab.setPrefWidth(labDefaultWidth);
        stuNumLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //541322标签
        Label zsStuNumLab = new Label("541322");
        ObservableList<Node> children = stuNumHBox.getChildren();
        children.addAll(stuNumLab,zsStuNumLab);


    }

    /**
     * 账号横向盒子
     * @param accountHBox
     */
    private void initAccountHBox(HBox accountHBox) {
        accountHBox.setPadding(new Insets(20));
        accountHBox.setSpacing(20);
        //账号标签
        Label accountLab = new Label("账号");
        accountLab.setPrefWidth(labDefaultWidth);
        accountLab.setFont(Font.font(null,FontWeight.BOLD,null,20));
        //zhangsan@126.com标签
        Label zsAccountLab = new Label("zhangsan@126.com");
        ObservableList<Node> children = accountHBox.getChildren();
        children.addAll(accountLab,zsAccountLab);
    }

    /**
     * 审核报名学员信息横向盒子
     * @param auditApplyStuInfoHBox
     */
    private void initAuditApplyStuInfoHBox(HBox auditApplyStuInfoHBox) {
        auditApplyStuInfoHBox.setPadding(new Insets(20));
        //审核学员报名信息标签
        Label auditApplyStuInfoLab = new Label("审核学员报名信息");
        //设置字体大小
        auditApplyStuInfoLab.setFont(Font.font(null, FontWeight.BOLD,null,22));
        auditApplyStuInfoLab.setTextFill(Color.rgb(198,0,1));//字体颜色
        auditApplyStuInfoHBox.getChildren().addAll(auditApplyStuInfoLab);

    }

    /**
     * 顶部横向盒子
     * @param topHBox
     */
    private void initTopHBox(HBox topHBox) {
        topHBox.setSpacing(20);
        topHBox.setPadding(new Insets(20));
        //顶部标签
        Label topLab = new Label("当前位置：🏠>招生管理>报名学员管理>审核学员报名信息");
        topLab.setFont(new Font(20));//设置字体大小
        ObservableList<Node> children = topHBox.getChildren();
        children.addAll(topLab);
    }

}
